//1.id,通过id找到页面元素，只能找到一个，页面设置多个相同的id会报错
let app = document.getElementById('app')
app.style.backgroundColor = '#ddd'
//2.class多个元素，可以使用for和下标元素
let olList = document.getElementsByClassName('ol-list')
for (let i = 0; i < olList.length; i++) {
    olList[i].style.listStyle = 'none'
}
//3.tag,多个元素，可以使用for和下标找到元素
let a = document.getElementsByTagName('a')
for (let i = 0; i < a.length; i++) {
    a[i].style.textDecoration = 'none'
    a[i].style.color = 'red'
}
//4.querSelecyor("css选择器")：只能获得一个
let applet = document.querySelector('#app')
applet.style.border = '5px solid black'
//5. querSelectorAll("css选择器")：获得很多个，哪怕是id
let applet1 = document.querySelectorAll('app')
for (let i = 0; i < applet1.length; i++) {
    applet1[i].style.backgroundColor = 'yellow'
}